home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / sm32a.zip / LIBRARY / NINTE.LI < prev    next >
Text File  |  1993-10-16  |  496b  |  13 lines

  1. # The numeric integration library "NInte.fun"
  2. # ninte(f,x,a,b) gives a numeric approximation to the definite 
  3. # integral of f from a to b. ninte() is different from num(inte()),
  4. # num(inte(f,x,a,b)) first evaluates 
  5. # the symbolic definite integral and then converts to a numerical value.
  6. # e.g. ninte(x^2,x,0,1)
  7. # See also: nsolve, inte.
  8.  
  9. ninte(y_,x_,a_,b_) := block(numeric:=on,
  10.     ninte:=(b-a)/50,
  11.     (sum(y,x,a+ninte,b-ninte,ninte)+(subs(y,x=a)+subs(y,x=b))/2)*ninte,
  12.     local(ninte))
  13.